]> dgit.raspbian.org Git - gnome-shell.git/commit
breakManager: Add new state machine for screen time/health breaks
authorPhilip Withnall <pwithnall@gnome.org>
Mon, 4 Mar 2024 16:13:53 +0000 (16:13 +0000)
committerPhilip Withnall <pwithnall@gnome.org>
Thu, 28 Nov 2024 10:44:10 +0000 (10:44 +0000)
commitdf3b4d302d43519a460ceb897b4693696f3d0449
treee51eac2755aadcdc5406b83836b56eadd83d9a31
parent03e3d9f435b5e23ae4c43dc30846d18e02526ced
breakManager: Add new state machine for screen time/health breaks

This implements health break reminder support in gnome-shell. It depends
on a
few bits and bobs from other modules:
 - New settings schemas in gsettings-desktop-schemas (released in
   47.beta, which Mutter already depends on)
 - A settings UI in gnome-control-center
 - User documentation in gnome-user-docs

It implements the design from
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.

The core of the implementation is `BreakManager`, which is a state
machine which uses the Mutter `IdleMonitor` to track whether the user
is, or should be, in a screen time break.

The `BreakDispatcher` is based on top of this, and controls showing
notifications, countdown timers, screen fades, the lock shield, etc. to
make the user aware of upcoming or due breaks, as per their notification
preferences.

Unit tests are included to check that `BreakManager` works. These
provide mock implementations of basic GLib clock functions, the
`IdleMonitor` and `Gio.Settings` in order to test the state machine in
faster-than-real-time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
See: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/130
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
14 files changed:
data/dbus-interfaces/meson.build
data/dbus-interfaces/org.gnome.Shell.ScreenTime.xml [new file with mode: 0644]
data/gnome-shell-dbus-interfaces.gresource.xml
data/gnome-shell-icons.gresource.xml
data/icons/scalable/status/wellbeing-symbolic.svg [new file with mode: 0644]
data/theme/gnome-shell-sass/widgets/_osd.scss
js/js-resources.gresource.xml
js/misc/breakManager.js [new file with mode: 0644]
js/ui/main.js
js/ui/shellDBus.js
meson.build
po/POTFILES.in
tests/meson.build
tests/unit/breakManager.js [new file with mode: 0644]